export default class extends Phaser.State{
    constructor () {
        super()
    }
    preload() {
        this.load.image('bg', 'assets/bg.png');
        this.load.image('btn_play', 'assets/btn-play.png');
    }
    init() {
        this.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;
    }
    create() {
        var bg = this.add.image(0, 0,'bg')
        bg.scale.set(1.2,1.2)
        //在舞台中心添加点击开始游戏图片
        var startBtn = this.add.image(window.gameWidth / 2, 1050, 'btn_play');
        startBtn.anchor.setTo( .5, .5 )
        startBtn.inputEnabled = true
        startBtn.events.onInputDown.add( () => {
            game.state.start('map')
        }, startBtn )
    }
}